package com.java.pojo.bo;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 用户新增或修改地址的BO
 */
@Data
public class AddressBO {

    private String addressId;

    @NotBlank(message = "用户ID不能为空")
    private String userId;
    @NotBlank(message = "收货人姓名不能为空")
    private String receiver;
    @NotBlank(message = "手机号码不能为空")
    @Size(min = 11, max = 11, message = "手机号码长度不正确")
    @Pattern(regexp = "^(((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(16[6])|(17[0135678])|(18[0-9])|(19[89]))\\d{8})$", message = "手机号格式错误")
    private String mobile;
    @NotBlank(message = "省份不能为空")
    private String province;
    @NotBlank(message = "省市不能为空")
    private String city;
    @NotBlank(message = "所在地不能为空")
    private String district;
    @NotBlank(message = "详细地址不能为空")
    private String detail;

}
